package cn.mst.vrs.dal.mysql.payrefund;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.mst.vrs.controller.admin.payrefund.vo.PayRefundPageReqVO;
import cn.mst.vrs.dal.dataobject.payrefund.PayRefundDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 支付退款单 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface PayRefundMapper extends BaseMapperX<PayRefundDO> {

    default PageResult<PayRefundDO> selectPage(PayRefundPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PayRefundDO>()
                .eqIfPresent(PayRefundDO::getPayId, reqVO.getPayId())
                .eqIfPresent(PayRefundDO::getDueRefund, reqVO.getDueRefund())
                .eqIfPresent(PayRefundDO::getRealRefund, reqVO.getRealRefund())
                .eqIfPresent(PayRefundDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(PayRefundDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PayRefundDO::getId));
    }

}